<?php
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
if($_RQ['op']=='list'){
		$return=array();
		$openid=$_RQ['openid']?:$_SESSION['openid'];
		if($_RQ['key']){
			$posterset=$this->plugin_setting('poster'.$_RQ['key']);	
		}else{
			$posterset=$this->plugin_setting('poster');
		}
		$posterset=$this->plugin_setting('poster');
		$member=model('core/member')->detail($_SESSION['uid'],array('credit1','credit2','mobile','avatar','nickname'));
		if($_RQ['key']){
			$url=custom_url('jy_team2fee/myhome/main/mid='.$_SESSION['uid'].'&fromstore='.$_SESSION['uid'],true);
		}else{
			$url=custom_url('jy_team2fee/myhome/main/mid='.$_SESSION['uid'].'&fromuser='.$_SESSION['uid'],true);
		}
		$qr=cfc('tools')->createqrcode($url,'250',true);
		$qr=tomedia($qr);
		if($_RQ['key']){
			$image='oss/'.$_SESSION['uniacid'].'/images/jy_team2fee/fromstore'.$_SESSION['uid'].'.jpg';
		}else{
			$image='oss/'.$_SESSION['uniacid'].'/images/jy_team2fee/wxappid'.$_SESSION['uid'].'.jpg';
		}
		$isadd=cfc('files')->source_check($image);
		if(!$isadd && $_SESSION['wxapp_id']){
			if($_RQ['key']){
				$wxappurl='/jy_team2fee/myhome/index?mid='.$_SESSION['uid'].'&fromstore='.$_SESSION['uid'];
			}else{
				$wxappurl='/jy_team2fee/myhome/index?mid='.$_SESSION['uid'].'&fromuser='.$_SESSION['uid'];
			}
			$wxapp=pdo_get('core_account_wxapp',array('id'=>$_SESSION['wxapp_id'],'uniacid'=>$_SESSION['uniacid']));
			$res=model('core/wxapp')->appcode($wxappurl,$wxapp['appid'],$wxapp['appsecret'],200);
			$path='oss/'.$_SESSION['uniacid'].'/images/jy_team2fee/';
			if(!file_exists(ROOT_AT.$path)){
					mkdir(ROOT_AT.$path,0700, true);
			}
			$qr=cfc('files')->source_save($res,'image','png','二维码',$image,'',$wxappurl);
		}
		$return=plugin('jy_poster')->get_active('','','',$openid,$qr,$posterset['data'],'jy_team2fee');
		$img=tomedia($return['member']['avatar']);
		$return['sharedata']=array(
			'title'=>$return['member']['nickname'].'的海报',
			'desc'=>$return['member']['nickname'].'的海报,欢迎浏览！！',
			'link'=>$url,
			'imgUrl'=>$img,
		);
		set_html('title',$return['member']['nickname'].'的海报');
		exi($return);
}
?>